<template>
  <div class="child">
    <h3>子组件</h3>
    <h4>子的玩具：{{ toy }}</h4>
    <h4>子的车：{{ car }}</h4>
    <br />
    <button @click="sendToy(toy)">把玩具给父</button>
  </div>
</template>
<script setup lang="ts">
import { ref } from 'vue'
let toy = ref('玩具汽车')
defineProps(['car', 'sendToy'])
</script>
<style scoped>
.child {
  background-color: greenyellow;
  box-shadow: 0 0 10px;
  border-radius: 10px;
  padding: 10px;
}
</style>
